package com.fpx.order.plat.bussiness.controller;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.fpx.order.plat.bussiness.service.order.IOriginOrderService;
import com.fpx.order.plat.bussiness.service.order.IOriginOrderitemService;
import com.fpx.order.plat.bussiness.service.order.IOrignOrderaddrService;


/**
 * 
 * desc: OrderManagerController
 * @author xiangtao(xiangtao@4px.com)
 * @date 2016年1月5日 上午9:25:37
 * @version 1.0
 */
@Controller
@RequestMapping(value="order")
public class OrderManageController {
	
	@Autowired
	private IOriginOrderService originOrderService;
	@Autowired
	private IOriginOrderitemService originOrderitemService;
	
	@Autowired
	private IOrignOrderaddrService originOrderaddrService;
	
	@RequestMapping(value="/gotomainjsp")
	public String gotomainjsp(){
		return "/main";
	}
	
	/**
	 * 
	 * <p>Title: gotoOrderjsp</p>
	 * <p>Desc: 跳转到订单页面</p>
	 * @author xiangtao(xiangtao@4px.com)
	 * @date 2016年1月5日 上午9:30:37 
	 * @version 1.0
	 * @return
	 */
	@RequestMapping(value="gotoOrderjsp")
	public String gotoOrderjsp(){
		
		return "order/findorder";
	}
	
	
	
	/**
	 * <p>Title: findOrderPage</p>
	 * <p>Desc: 查询订单页面</p>
	 * @author xiangtao(xiangtao@4px.com)
	 * @date 2016年1月5日 上午9:28:44 
	 * @version 1.0
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value="findOrderPage",method=RequestMethod.POST)
	public Map<String,Object> findOrderPage(@RequestParam Map<String,Object> reqMap){
		Map<String,Object> resultMap=new HashMap<String,Object>();
		try
		{	resultMap=originOrderService.findPageOrder(reqMap);
			return resultMap;
		} catch (Exception e)
		{
			e.printStackTrace();
		}
		return resultMap;
	}
	/**
	 * 
	 * <p>Title: findOrderItemPage</p>
	 * <p>Desc: 分页查询订单货品信息</p>
	 * @author xiangtao(xiangtao@4px.com)
	 * @date 2016年1月19日 上午11:08:50 
	 * @version 1.0
	 * @param reqMap
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value="findOrderItemPage",method=RequestMethod.POST)
	public Map<String,Object>findOrderItemPage(@RequestParam Map<String,Object> reqMap){
		Map<String,Object> resultMap=new HashMap<String,Object>();
		try{
			resultMap=originOrderitemService.findPageOrderItem(reqMap);
			return resultMap;
		}catch(Exception e){
			e.printStackTrace();
		}
		return resultMap;
	}
	
	@ResponseBody
	@RequestMapping(value="findOrderAddrPage",method=RequestMethod.POST)
	public Map<String,Object>findOrderAddrPage(@RequestParam Map<String,Object> reqMap){
		Map<String,Object> resultMap=new HashMap<String,Object>();
		try{
			resultMap=originOrderaddrService.findPageOrderAddr(reqMap);
			return resultMap;
		}catch(Exception e){
			e.printStackTrace();
		}
		return resultMap;
	}
}

